#include "CalClient.hpp"

#include <memory>

using namespace client;
using namespace std;

// 使用手册
static void Usage(string proc)
{
    std::cerr << "\nUsage:\r\n"
              << proc << " local_port\n\n";
}

// ./calclient serverip serverport
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(1);
    }
    std::string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    std::unique_ptr<CalClient> tclient(new CalClient(serverip, serverport));
    tclient->initClient();
    tclient->start();

    return 0;
}
